﻿using Furion;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace ECO.Admin.Core.Sugar
{
    public static class SugarExtention
    {
        public static void MigrationDatabase(this ISqlSugarClient db)
        {
            db.DbMaintenance.CreateDatabase();
            var types = Assembly.GetExecutingAssembly().GetTypes().Where(x => x.Namespace.Contains( "ECO.Admin.Core.Entities")).ToArray();
            db.CodeFirst.SetStringDefaultLength(500).InitTables(types);
        }

    }
}
